package com.qing.qingpicturebackend.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qing.qingpicturebackend.model.dto.user.UserLoginRequest;
import com.qing.qingpicturebackend.model.dto.user.UserQueryRequest;
import com.qing.qingpicturebackend.model.dto.user.UserRegisterRequest;
import com.qing.qingpicturebackend.model.entity.User;
import com.qing.qingpicturebackend.model.vo.UserVO;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;

/**
* @author 86157
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-04-27 23:10:40
*/
public interface UserService extends IService<User> {

    String getEncryptPassword(String userPassword);
    /**
     * 用户注册
     *
     * @param request   用户账户

     * @return 新用户 id
     */
    boolean userRegister(UserRegisterRequest request);
    /**
     * 用户登录
     *
     * @param userLoginRequest  用户账户
     * @param request
     * @return 脱敏后的用户信息
     */
    HashMap<String, Object> userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * 获取当前登录用户
     *
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 获取查询条件
     * @param userQueryRequest
     * @return
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 获取用户 VO 列表
     * @param userList
     * @return
     */
    List<UserVO> getUserVOList(List<User> userList);
}
